import { checkProduct } from '@/assets/js/utils'

export default {
    methods: {
        checkReg() {
            if (this.$store.state.userInfo.isLogin) {
                this.$confirm(
                    '你已注册校园事业部，是否直接进入事业部后台？',
                    '',
                    {
                        confirmButtonText: '进入',
                        cancelButtonText: '取消'
                    }
                )
                    .then(() => {
                        location.href = checkProduct()
                            ? '//cms.zsdx.cn?session_ticket=' +
                              this.$getSessionTicket()
                            : '//gt.wxhand.com?session_ticket=' +
                              this.$getSessionTicket()
                    })
                    .catch(() => {})
            } else {
                this.$store.commit('isLogin/SHOW_LOGIN', { type: 'reg' })
            }
        }
    }
}
